﻿


  
using System;
using SubSonic;
using SubSonic.Schema;
using SubSonic.DataProviders;
using System.Data;

namespace myMvcBlog{
	public partial class MvcBlogDB{

        public StoredProcedure AddCategory(string name,string encodedName){
            StoredProcedure sp=new StoredProcedure("AddCategory",this.Provider);
            sp.Command.AddParameter("name",name,DbType.String);
            sp.Command.AddParameter("encodedName",encodedName,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure AddComment(long postId,string content,string commentorName,string commentorEmail,string commentorSite,string commentorIP,DateTime commentTime){
            StoredProcedure sp=new StoredProcedure("AddComment",this.Provider);
            sp.Command.AddParameter("postId",postId,DbType.Int64);
            sp.Command.AddParameter("content",content,DbType.String);
            sp.Command.AddParameter("commentorName",commentorName,DbType.String);
            sp.Command.AddParameter("commentorEmail",commentorEmail,DbType.AnsiString);
            sp.Command.AddParameter("commentorSite",commentorSite,DbType.AnsiString);
            sp.Command.AddParameter("commentorIP",commentorIP,DbType.AnsiString);
            sp.Command.AddParameter("commentTime",commentTime,DbType.DateTime);
            return sp;
        }
        public StoredProcedure AddPost(long ID,string Title,string Excerpt,string Content,DateTime postedTime){
            StoredProcedure sp=new StoredProcedure("AddPost",this.Provider);
            sp.Command.AddParameter("ID",ID,DbType.Int64);
            sp.Command.AddParameter("Title",Title,DbType.String);
            sp.Command.AddParameter("Excerpt",Excerpt,DbType.String);
            sp.Command.AddParameter("Content",Content,DbType.String);
            sp.Command.AddParameter("postedTime",postedTime,DbType.DateTime);
            return sp;
        }
        public StoredProcedure AddPostCategory(long postId,string categoryName){
            StoredProcedure sp=new StoredProcedure("AddPostCategory",this.Provider);
            sp.Command.AddParameter("postId",postId,DbType.Int64);
            sp.Command.AddParameter("categoryName",categoryName,DbType.String);
            return sp;
        }
        public StoredProcedure AddPostLink(long postId,string link){
            StoredProcedure sp=new StoredProcedure("AddPostLink",this.Provider);
            sp.Command.AddParameter("postId",postId,DbType.Int64);
            sp.Command.AddParameter("link",link,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure AddTag(long postId,string name,string niceTagName){
            StoredProcedure sp=new StoredProcedure("AddTag",this.Provider);
            sp.Command.AddParameter("postId",postId,DbType.Int64);
            sp.Command.AddParameter("name",name,DbType.String);
            sp.Command.AddParameter("niceTagName",niceTagName,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure clearCategory(){
            StoredProcedure sp=new StoredProcedure("clearCategory",this.Provider);
            return sp;
        }
        public StoredProcedure ClearPost(){
            StoredProcedure sp=new StoredProcedure("ClearPost",this.Provider);
            return sp;
        }
        public StoredProcedure GetMonthlyArchive(){
            StoredProcedure sp=new StoredProcedure("GetMonthlyArchive",this.Provider);
            return sp;
        }
	
	}
	
}
 